import React, { Component } from 'react'

export default class fengmian extends Component {
    state = {isPlay:false}
    play_audio=() => {
        this.setState({isPlay:true})
    }
    pause_audio=() => {
        this.setState({isPlay:false})
    }
    render() {
        var music_img = ""
        if(this.props.pic_url === "")
            music_img = "/img/img1.jpg"
        else
            music_img = this.props.pic_url
        return (
            <div className="content">
                <div className={`fengmian ${this.state.isPlay === true?"xuanzuan":null}`} style={{backgroundImage:'url('+music_img+')'}}>
                        
                </div>
                <audio id="audio" src={this.props.music_url===""?'#':this.props.music_url} className="au" onPlay={this.play_audio} onPause={this.pause_audio} controls />
            </div>
        )
    }
}
